#pragma once

#include "Platform.h"
#include "Player.h"
#include "HealthPack.h"

class LevelEditor : public Zeni::Gamestate_Base
{
	public:
		LevelEditor(int levelNum);
		~LevelEditor();

	private:
		std::string filename;
		std::string levelName;
		Player* player;
		std::vector<Platform*> platforms;
		std::vector<Player*> npcs;
		std::vector<HealthPack*> healthPacks;
		std::pair<Zeni::Point2f, Zeni::Point2f> viewArea;
		Zeni::Quadrilateral<Zeni::Vertex2f_Texture> background1;
		Zeni::Quadrilateral<Zeni::Vertex2f_Texture> background2;
		Platform* ground;
		float timeSinceMove;
		bool controlHeld;
		Platform *newPlatform;
		Zeni::Point2f mousePrev2f;
		Vector2 mousePrev;
		bool panning;
		bool mouseDown;
		GameObject *moveObject;
		Player* movingPlayer;

		struct Controls
		{
			bool left;
			bool right;
			bool up;
			bool down;
			Controls() : left(false), right(false), up(false), down(false){}
		} controls;

		std::string draw;
		void zoom(int dz);
		void save();
		GameObject* hoverObject(Vector2 mouse);
		void determineBackground();
		void perform_logic();
		void on_key(const SDL_KeyboardEvent &event);
		void on_mouse_motion(const SDL_MouseMotionEvent &event);
		void on_mouse_button(const SDL_MouseButtonEvent &event);
		void render();		
};